package com.st.service.serviceImpl;

import com.st.pojo.GoodsDetail;
import com.st.vo.GoodsDetailListVo;
import com.st.vo.goodsImgListVo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.st.dao.GoodsImgMapper;
import com.st.pojo.GoodsImg;
import com.st.service.GoodsImgService;
@Service
public class GoodsImgServiceImpl extends ServiceImpl<GoodsImgMapper, GoodsImg> implements GoodsImgService {

    @Resource
    private GoodsImgMapper goodsImgMapper;

    @Override
    public int batchInsert(List<GoodsImg> list) {
        return baseMapper.batchInsert(list);
    }

    @Override
    public List<goodsImgListVo> getList() {
        List<goodsImgListVo> goodsImgLists = new ArrayList<>();
        List<GoodsImg> goodsImg = goodsImgMapper.selectList(null);
        for (GoodsImg goodsimg : goodsImg) {
            goodsImgListVo goodsImgListVo = new goodsImgListVo(goodsimg.getImgUrl(),goodsimg.getGoodsId());
            goodsImgLists.add(goodsImgListVo);
        }
        return goodsImgLists;
    }
}

/*为了提交*/